var base = require('/base_info.js');
var utils = require('/utils/index.js');
var common = require('/utils/common.js');
Page({
  data: {
    imgUrl: base.imgUrl
  },
  onLoad(query) {
    let that = this;
    console.log(JSON.parse(query.data));
    var data = JSON.parse(query.data);
    var nowTime = new Date();
    that.setData({
      orderInfo: data,
      order_id: query.order_id
    });
  },

  // 跳转到订单
  orderDetail() {
    my.redirectTo({
      url: './order-detail?id=' + this.data.order_id
    });
  },
  // 返回首页
  home () {
    my.navigateBack({
      delta: 100
    });
  },
  onReady() {
    // 页面加载完成
  },
  onShow() {
    // 页面显示
  },
  onHide() {
    // 页面隐藏
  },
  onUnload() {
    // 页面被关闭
  },
  onTitleClick() {
    // 标题被点击
  },
  onPullDownRefresh() {
    // 页面被下拉
  },
  onReachBottom() {
    // 页面被拉到底部
  },
  onShareAppMessage() {
    // 返回自定义分享信息
    return {
      title: my.getStorageSync({
        key: 'hotel_name', // 缓存数据的key
      }).data,
      desc: my.getStorageSync({
        key: 'my_app_description', // 缓存数据的key
      }).data,
      path: 'pages/index/index?share=true',
      success: function (e) {
        console.log(e);
      }
    };
  },
});
